const { execSync } = require("child_process")

// env detection
let _hasYarn
exports.hasYarn = () => {
  if (_hasYarn != null) {
    return _hasYarn
  }
  try {
    execSync("yarn --version", { stdio: "ignore" })
    return (_hasYarn = true)
  } catch (e) {
    return (_hasYarn = false)
  }
}
